export type QuestionType = 'choice' | 'judge';

export interface Question {
  id: string;
  type: QuestionType;
  title: string;
  options?: string[]; // Only for choice
  correctAnswer: string | string[]; // String for judge/single, Array for multi
  explanation: string;
  hint?: string;
}

export interface ExamResult {
  score: number;
  total: number;
  correct: number;
  timestamp: number;
  userAnswers: Record<string, string | string[]>; // Serialized map
}

export interface Quiz {
  id: string;
  title: string;
  description: string;
  questions: Question[];
  createdAt: number;
  latestResult?: ExamResult;
}

export interface UserAnswer {
  questionId: string;
  answer: string | string[];
}

export interface MistakeQuestion extends Question {
  addedAt: number;
}

export interface MistakeNotebook {
  id: string;
  name: string;
  questions: MistakeQuestion[];
  createdAt: number;
}

export type AppView = 'HOME' | 'GENERATING' | 'EXAM_PREVIEW' | 'EXAM_RUNNING' | 'RESULT' | 'REVIEW' | 'MISTAKE_NOTEBOOK';